package org.vector.view;

import java.awt.FlowLayout;
import java.awt.Font;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JTextField;

import org.vector.daoImpl.BookDaoImpl;

@SuppressWarnings("serial")
public class WinMoneyset extends JFrame{
	BookDaoImpl bdi = new BookDaoImpl();
	private JLabel j1,j2;
	private JButton b1,b2;
	private JTextField txt;
	
	public WinMoneyset(){
		into();
		setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
		setVisible(true);
		
	}
	private void into() {
		
		setBounds(500, 270, 600, 300);
		setTitle("罚金设置");
		setLayout(new FlowLayout());
		
		j1 = new JLabel("罚金设置");
		j2 = new JLabel("元/分钟");
		
		b1 = new JButton("设置");
		b2 = new JButton("退出");
		
		txt = new JTextField(20);
		
		j1.setFont(new Font("宋体", 0, 30));
		j2.setFont(new Font("宋体", 0, 30));
		b1.setFont(new Font("宋体", 0, 30));
		b2.setFont(new Font("宋体", 0, 30));
		txt.setFont(new Font("宋体", 0, 30));
		
		
		b1.addActionListener(new ActionListener() {
			@Override
			public void actionPerformed(ActionEvent e) {
				//设置
				String a = txt.getText();
				int aa = Integer.valueOf(a);
				Money.money= aa;
				WinMoneyset.this.dispose();
			}
		});
		b2.addActionListener(new ActionListener() {
			@Override
			public void actionPerformed(ActionEvent e) {
				WinMoneyset.this.dispose();
			}
		});
		
		add(j1);
		add(txt);
		add(j2);
		add(b1);
		add(b2);
		
	}
	
	public static void main(String[] args) {
		new WinMoneyset();
	}
}
